package com.bs.blogspace.controller;

import com.bs.blogspace.model.Result;
import com.bs.blogspace.pojo.Like;
import com.bs.blogspace.service.LikeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Slf4j
public class LikeController {
    @Autowired
    private LikeService likeService;
    @PostMapping("/likeEssay")
    @ResponseBody
    public Result likeEssay(@RequestBody Like like){
        log.info("添加点赞,{}",like);
        return likeService.addLike(like);
    }
}
